package model;

public class Seat 
{
	private int id;
	private int row;
	private int number;
	private Cinema cinema;
	
	public Seat(int id, int row, int number, Cinema cinema)
	{
		this.id = id;
		this.row = row;
		this.number = number;
		this.cinema = cinema;
	}

	public int getId() 
	{
		return id;
	}

	public void setId(int id) 
	{
		this.id = id;
	}

	public int getRow() 
	{
		return row;
	}

	public void setRow(int row) 
	{
		this.row = row;
	}

	public int getNumber() 
	{
		return number;
	}

	public void setNumber(int number) 
	{
		this.number = number;
	}

	public Cinema getCinema() 
	{
		return cinema;
	}

	public void setCinema(Cinema cinema) 
	{
		this.cinema = cinema;
	}
	
	@Override
	public boolean equals(Object obj) {
		boolean result = true;
		try {
			Seat otherSeat = (Seat) obj;
			result = id == otherSeat.getId();
		}
		catch(Exception e) {
			result = false;
		}
		
		return result;
	}
}
